

FROM ubuntu:20.04 AS build

EXPOSE 50046/tcp
EXPOSE 50046/udp
EXPOSE 50045/tcp

LABEL maintainer="daixingdeng"


RUN apt-get update && \
         DEBIAN_FRONTEND="noninteractive" \
         apt-get install -y --no-install-recommends \
         wget \
         cmake \
         maven \
         git \
         ca-certificates \
         tzdata \
         curl \
         libpcre3 \
         libpcre3-dev \
         zlib1g-dev \
         openssl \
         libssl-dev \
         gdb && \
         apt-get autoremove -y && \
         apt-get clean -y && \
         rm -rf /var/lib/apt/lists/*

# install jdk1.8
RUN mkdir -p /opt/download
WORKDIR /opt/download
RUN if [ "$Platfrom" = "arm64" ]; \
    then \
        wget https://polaris-tian-generic.pkg.coding.net/qt/autopliot/jdk-8u411-linux-aarch64.tar.gz?version=latest --no-check-certificate -O jdk-8.tar.gz && \
        tar -zxvf /opt/download/jdk-8.tar.gz -C /usr/local/ --transform 's/jdk1.8.0_411/java/' && \
        rm /opt/download/jdk-8.tar.gz; \
    else \
        wget https://polaris-tian-generic.pkg.coding.net/qt/autopliot/jdk-8u202-linux-x64.tar.gz?version=latest --no-check-certificate -O jdk-8.tar.gz && \
        tar -zxvf /opt/download/jdk-8.tar.gz -C /usr/local/ --transform 's/jdk1.8.0_202/java/' && \
        rm /opt/download/jdk-8.tar.gz; \
    fi

ENV JAVA_HOME /usr/local/java/
ENV JRE_HOME ${JAVA_HOME}/jre
ENV CLASSPATH .:${JAVA_HOME}/lib:${JRE_HOME}/lib
ENV PATH ${JAVA_HOME}/bin:$PATH

RUN java -version && javac -version

RUN mkdir -p /mnt/wvp
WORKDIR /mnt/wvp

RUN mkdir -p /mnt/wvp/server/logs \
    /mnt/wvp/server/temp \
    /mnt/wvp/server/skywalking/agent

WORKDIR /mnt/wvp/server



ADD ./target/wvp-pro.jar ./app.jar
# 工作流字体文件
# ADD ./zhFonts/ /usr/share/fonts/zhFonts/

SHELL ["/bin/bash", "-c"]
ENTRYPOINT ["java", "-Xms512m", "-Xmx1024m", "-XX:+HeapDumpOnOutOfMemoryError", "-XX:HeapDumpPath=/mnt/wvp/ylcx/", "-jar", "app.jar"]

#ENTRYPOINT java -Djava.security.egd=file:/dev/./urandom -Dserver.port=${SERVER_PORT} \
#           # 应用名称 如果想区分集群节点监控 改成不同的名称即可
#           #-Dskywalking.agent.service_name=ruoyi-server \
#           #-javaagent:/ruoyi/skywalking/agent/skywalking-agent.jar \
#           -XX:+HeapDumpOnOutOfMemoryError -XX:+UseZGC ${JAVA_OPTS} \
#           -jar app.jar

